<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86155
  Date: 2022/3/14
  Time: 19:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>头部导航</title>
  <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
</head>
<body>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/navigation.css">
    <!-- 顶部导航栏-->
    <div class="headerTop">
      <div class="w-max ct">
        <div class="header_t1">
          <p>
            <a href="${pageContext.request.contextPath}/index.jsp" class="epet-index-brand">宠宠首页</a>
            <a href="${pageContext.request.contextPath}/index.jsp" class="epetbrand">宠宠就是正品</a>
            <c:if test="${empty loginCustomer}">
              <a href="${pageContext.request.contextPath}/customer/login.jsp" class="header_topri fr">登录</a>
              <a href="${pageContext.request.contextPath}/customer/regist.jsp" class="header_topri">免费注册</a>
            </c:if>
            <c:if test="${! empty loginCustomer}"> <%--表示session中绑定了用户--%>
              <span class="header_topri fr">你好,${loginCustomer.custumerName}</span>
              <a href="${pageContext.request.contextPath}/customer/logout" class="header_topri">退出</a>
            </c:if>
            <a href="${pageContext.request.contextPath}/shopCart" class="header_topri">购物车</a>
            <a href="${pageContext.request.contextPath}/customer/${loginCustomer.custumerId}" class="header_topri">我的宠宠</a>
            <a href="https://www.epet.com/" class="header_topri">收藏</a>
            <a href="https://www.epet.com/" class="header_topri">问题反馈</a>


          </p>
        </div>
      </div>
    </div>

    <!--    logo + 搜索框-->
    <div class="head-newyear">
      <div class="header" style="padding-top: 10px;">
        <div class="w-max ct rel">
          <div class="logo logo-newyear f1 rela">
            <a href="${pageContext.request.contextPath}/index.jsp" class="lo"></a>
          </div>
          <div class="search-box">
            <input type="text" class="keyword">
          </div>
          <div class="search-btns">
            <input type="button" class="search-btn1" value="搜索">
          </div>
        </div>
      </div>
    </div>

<script>
  $(".search-btn1").click(function () {
    console.log("===========");
    var keyword = $(".keyword").val();
    console.log("keyword:" + keyword);
    var url = "${pageContext.request.contextPath}/pro/kw/" + keyword + "/page/1";
    console.log(url);
    location.href = url;
  })
</script>

</body>
</html>
